#ifndef __SYSTASK_H
#define __SYSTASK_H

#include "gpio.h"
/***********************************************************************************************************************
ϵͳ�������
***********************************************************************************************************************/
#define WECLCOME_INTERFACE 0
#define START_INTERFACE    1
#define MAIN_INTERFACE     2
#define MENU_INTERFACE     3     
#define SET_TENPERATURE    4
#define CALCULATOR         5
#define UART_BAUD_RATE     6
#define SETING             7
#define CLOCK_CURSOR_CTRL  8
#define ALARM              9
#define TEMPERATURE        0x0A
#define SET_CLOCK          0x0B
#define UI_CURRENT         0xFF
#define CLOCK_CTRL         0x0C
#define SAVE_SETING        0x0D
#define ALARM_TIME         0x0E
#define ALARM_TIME_SETING  0x0F

#define SYSTEM_UI_BUFF_MAX 16

typedef struct _SYSTEM_UI_T
{
        INT8U state;
        INT8U menuitem;
        INT8U delay_ms;
        INT8U welcome_delays;
        INT8U delay_s;
}SYSTEM_UI_T;

/***********************************************************************************************************************
�������ӿ�
***********************************************************************************************************************/
extern void system_init(void);
extern void system_drivers_process(void);
extern void system_tasks_process(void);
extern void system_ui_init(void);
extern void clock_cursor_ctrl(INT8U _menuitem, INT8U _interface);
extern void system_ui_alarm();
extern void system_ui_clock(SYS_TIME_T *sys_time_t_pointer);
extern void manual_ui_calendar(INT8U menuitem, SYS_TIME_T *sys_time_t_pointer, INT8U _interface);
extern void manual_ui_clock(SYS_TIME_T *sys_time_t_pointer);
extern void system_ui_process(void);
extern void ui_interface_switch(INT8U*_title, INT8U *_item, INT8U _target_interface, INT8U  _ui_parameters);
extern void state_switch(INT8U _target_state, INT8U _target_left_valve, INT8U _target_right_valve);
extern void value_change(INT8U *_value);
extern INT8U get_menus_item(INT8U _item_num);
extern void digital_clock(void);
extern void system_calendar_init();
extern void system_calendar(SYS_TIME_T *sys_time_t_pointer);
#endif
